 <template>
  <div class="home">
    <el-container>
      <!-- header部分 -->
      <el-header style="height: 75px;">
        <!-- logo部分 -->
        <div class="logo">
          <img src="../assets/logo.png" alt>
          <p>海川云谷</p>
        </div>
        <!-- 公共导航部分 -->
        <div class="system-title">
          <router-link to="/" class="el-breadcrumb-item">
            <a href="#">首页</a>
          </router-link>
          <router-link to="/Asset" class="el-breadcrumb-item">
            <a href="#">资产管理</a>
          </router-link>
          <router-link to="/Statistics" class="el-breadcrumb-item">
            <a href="#">统计分析</a>
          </router-link>
          <router-link to="/Check" class="el-breadcrumb-item">
            <a href="#">盘点管理</a>
          </router-link>
          <router-link to="/Board" class="el-breadcrumb-item">
            <a href="#">模块标签</a>
          </router-link>
        </div>
        <div>
          <el-menu
            :default-active="activeIndex"
            class="el-menu-demo"
            mode="horizontal"
            @select="handleSelect"
          >
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-bell"/>
              </template>
              <router-link class="el-menu-item" index="1-1" type="text" to="/Notice">
                关于网站使用说明
                <br>&nbsp; 2019-04-04 11:30
              </router-link>
            </el-submenu>
            <!-- 用户头像 -->
            <el-submenu index="2">
              <template slot="title" class="welcome">
                <img :src="'?imageView2/1/w/80/h/80'" class="user-avatar">
              </template>
              <el-menu-item index="2-1">
                <el-button type="text" @click="dialogFormVisible1 = true">个人中心</el-button>
              </el-menu-item>
              <el-menu-item index="2-3">
                <el-button type="text">
                  <router-link to="/User">用户管理</router-link>
                </el-button>
              </el-menu-item>
              <el-menu-item index="2-2" type="text" @click="logout">
                <el-button type="text">退出系统</el-button>
              </el-menu-item>
            </el-submenu>
          </el-menu>
          <!-- <span class="welcome">您好，{{$store.getters.account}}</span> -->
          <!-- <el-button type="text" @click="logout">退出</el-button> -->
          <el-dialog title="用户中心" :visible.sync="dialogFormVisible1">
            <el-form :model="form">
              <el-form-item label="头像" :label-width="formLabelWidth">
                <el-input v-model="form.name" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="用户名" :label-width="formLabelWidth">
                <el-input v-model="form.name" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="密码" :label-width="formLabelWidth">
                <el-input v-model="form.name" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="手机号" :label-width="formLabelWidth">
                <el-input v-model="form.name" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="账号" :label-width="formLabelWidth">
                <el-input v-model="form.name" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="企业名称" :label-width="formLabelWidth">
                <!-- <el-input v-model="form.name" auto-complete="off"></el-input> -->
                <span>武汉海川云谷软件技术有限公司</span>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button @click="dialogFormVisible1 = false">取 消</el-button>
              <el-button type="primary" @click="dialogFormVisible1 = false">确 定</el-button>
            </div>
          </el-dialog>
          <!--  <el-dialog title="用户管理" :visible.sync="dialogFormVisible2">
            <el-form :model="form">
              <el-form-item label="头像" :label-width="formLabelWidth">
                <el-input v-model="form.name" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="用户名" :label-width="formLabelWidth">
                <el-input v-model="form.name" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="密码" :label-width="formLabelWidth">
                <el-input v-model="form.name" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="手机号" :label-width="formLabelWidth">
                <el-input v-model="form.name" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="账号" :label-width="formLabelWidth">
                <el-input v-model="form.name" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="企业名称" :label-width="formLabelWidth">
                <span>武汉海川云谷软件技术有限公司</span>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button @click="dialogFormVisible1 = false">取 消</el-button>
              <el-button type="primary" @click="dialogFormVisible1 = false">确 定</el-button>
            </div>
          </el-dialog>-->
        </div>
      </el-header>
      <!-- 中间内容部分 -->
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>
           
<script>
export default {
  data() {
    return {
      isCollapse: false,
      menuData: [],
      activeIndex: "1",
      dialogFormVisible1: false,
      form: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: ""
      },
      formLabelWidth: "120px"
    };
  },
  methods: {
    toggleCollapse() {
      this.isCollapse = !this.isCollapse;
    },
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
    logout() {
      // 1. 清除登录状态，即删除保存在localStorage中的token
      localStorage.removeItem("mytoken");
      // 2. 跳转到登录页面
      this.$router.push({ name: "Login" });
    }
  },
  created() {}
};
</script>
<style lang="scss" scoped>
.home {
  height: 100%;
  .el-menu-admin:not(.el-menu--collapse) {
    width: 200px;
    min-height: 400px;
  }
  .el-container {
    height: 100%;
    padding: 0;
    box-sizing: border-box;
  }
  .el-header {
    width: 106%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #323232;
  }
  .el-menu {
    border: none;
    background-color: #323232;
    :hover {
      background-color: #ff9900;
    }
  }
  .el-main {
    width: 105%;
    background-color: #f3f6fb;
    padding: 0;
  }
  .el-breadcrumb-item {
    width: 108px;
    height: 50px;
    color: #999999;
    font-size: 16px;
    line-height: 28px;
  }
  a {
    text-align: center;
    line-height: 50px;
    display: inline-block;
    &:hover {
      background-color: #ff9900;
    }
  }
  .logo {
    width: 30px;
    height: 50px;
    position: relative;
    background-color: #323232;
    img {
      position: absolute;
      height: 40px;
      width: 43px;
      left: 10px;
      top: 10px;
    }
    p {
      display: inline-block;
      position: absolute;
      width: 73px;
      height: 25px;
      left: 60px;
      top: 33px;
      font-family: "Arial-BoldMT", "Arial Bold", "Arial";
      font-weight: 700;
      font-style: normal;
      color: #ff9900;
    }
  }
  .system-title {
    // width: 100%;
    font-size: 20px;
    color: #999999;
    padding: 30px 50px;
  }
  .logout-btn {
    color: orange;
  }
  .welcome {
    color: #ccc;
  }
  .avatar-wrapper {
    cursor: pointer;
    margin-top: 5px;
    position: relative;
    line-height: initial;
  }
  .user-avator {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 10px 10px;
  }
}
</style>



